<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('报销登记列表')"/>
</head>
<body class="gray-bg">

<input id="exType" name="exType" th:value="${exType}" type="hidden">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('work:expense:edit')}]];
    var removeFlag = [[${@permission.hasPermi('work:expense:remove')}]];
    var expenseTypeDatas = [[${@dict.getType('work_expense')}]];
    var expenseStatusDatas = [[${@dict.getType('work_check_status')}]];
    var payTypeDatas = [[${@dict.getType('work_out_type')}]];
    var bankNameDatas = [[${@dict.getType('work_bank')}]];
    var prefix = ctx + "work/expense";

    $(function () {
        var options = {
            url: prefix + "/cancel/"+$("#exType").val(),
            showSearch: false,
            showRefresh: false,
            showToggle: false,
            showColumns: false,
            columns: [{
                checkbox: true
            },
                {
                    field: 'expenseId',
                    title: '报销ID',
                    visible: false
                },
                {
                    field: 'expenseType',
                    title: '报销类型',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(expenseTypeDatas, value);
                    }
                },
                {
                    field: 'expenseFee',
                    title: '报销费用'
                },
                {
                    field: 'expenseStatus',
                    title: '审核状态',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(expenseStatusDatas, value);
                    }
                },
                {
                    field: 'payType',
                    title: '支出类型',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(payTypeDatas, value);
                    }
                },
                {
                    field: 'bankName',
                    title: '银行名称',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(bankNameDatas, value);
                    }
                },
                {
                    field: 'bankAccount',
                    title: '银行账号'
                },

                {
                    field: 'expenser',
                    title: '报销人'
                },

                {
                    field: 'remark',
                    title: '报销内容概要'
                }]
        };
        $.table.init(options);
    });
    /* 添加用户-选择用户-提交(回调形式-父页面调用子页面) */
    function getSelections() {
        var row = $("#bootstrap-table").bootstrapTable('getSelections');
        return row;
    }

</script>
</body>
</html>